package com.atguigu.ucenter.member.controller.client;

import com.atguigu.ucenter.member.service.MemberService;
import com.atguigu.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author zy
 */
@RestController
@CrossOrigin
@RequestMapping("/ucenter/service/client")
@Api(value = "ClientStatisticsController", description = "获取指定日期注册人数")
public class ClientStatisticsController {

    @Resource
    private MemberService memberService;

    /**
     * 根据日期查询
     */
    @GetMapping("/getStatistics/{date}")
    @ApiOperation("根据指定日期获得注册人数")
    public R getStatistics(@PathVariable String date) {
        int i = memberService.getRegisterCount(date);
        return R.ok().data("count", i);
    }


}
